package com.xczl.demo.action.front;


import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xczl.demo.domain.User;

@Controller
public class IndexAction {


	@RequestMapping("index.htm")
	public String index(HttpServletRequest request,ModelMap model) {
		System.out.println("进入主页");
		User user = (User) request.getSession().getAttribute(User.SESSION_ID);
		if(user!= null){
			model.addAttribute("user1", user);
		}
		model.addAttribute("regStr", "注册");
		model.addAttribute("loginStr", "登录");
		return "front/index";
	}
}
